﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PayrollHR.Web;
using Payroll.BusinessLogic.EmployeeManagement;
using Payroll.BusinessLogic;
using Payroll.Common.Utils;

namespace PayrollHR.Administration.Modules
{
    public partial class EmployeeInfo : BasePayrollAdministrationUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            { }
        }
        public Employee getEmployee()
        {
            Employee _employee = new Employee { 
                Name = txtEmployeeName.Text, 
                Username = txtTenDangNhap.Text,
                PasswordHash = "123456", 
                Mobile = txtMobile.Text, 
                Phone = txtPhone.Text, 
                EmailAddress = txtEmail.Text, 
                Active = true,
                IsAdmin = true
            };
            return _employee;
        }
        public void bindData(Employee _employee)
        {
            txtEmployeeName.Text = _employee.Name;
            txtTenDangNhap.Text = _employee.Username;
            txtPhone.Text = _employee.Phone;
            txtMobile.Text = _employee.Mobile;
            txtEmail.Text = _employee.EmailAddress;          
        }
    }
}